layui.use(['layer', 'form', 'table', 'admin', 'ax','upload'], function () {
    var $ = layui.$;
    var layer = layui.layer;
    var form = layui.form;
    var $ax = layui.ax;
    var admin = layui.admin;
    var upload = layui.upload;

    // 让当前iframe弹层高度适应
    admin.iframeAuto();
    // 表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        var aflg = $("#aFlg option:selected").val();
        var bflg = $("#bFlg option:selected").val();
        var status = $("#status").val();
        if(aflg == '' || bflg == ''){
            Feng.error("请选择是否结费");
            return false;
        }
        if(status == '' || status == undefined){
            Feng.error("参数错误");
            return false;
        }
        var url = $("#url").val();
        var ajax = new $ax(Feng.ctxPath + "/"+url+"/edit", function (data) {
            Feng.info(data.message);
            //传给上个页面，刷新table用
            admin.putTempData('formOk', true);
            //关掉对话框
            admin.closeThisDialog();
        }, function (data) {
            Feng.error("失败!" + data.responseJSON.message + "!");
        });
        ajax.set("aFlg", aflg);
        ajax.set("bFlg", bflg);
        ajax.set("status", status);
        ajax.set("id", $("#id").val());
        ajax.start();
    });
});

